import 'package:demo1/common/style/style.dart';
import 'package:flutter/material.dart';

class UiAddressbookSort extends StatefulWidget {
  const UiAddressbookSort({Key? key}) : super(key: key);

  @override
  _UiAddressbookSortState createState() => _UiAddressbookSortState();
}

class _UiAddressbookSortState extends State<UiAddressbookSort> {
  List<Map> items = [
    {"id": "A", "name": "常用联系人", "icon": Icons.add},
    {"id": "B", "name": "新朋友", "icon": Icons.person},
    {"id": "C", "name": "我的好友", "icon": Icons.new_label}
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        toolbarHeight: 35,
        shadowColor: Colors.transparent,
        title: const Text(
          '通讯录',
          style: TextStyle(color: Colors.white, fontSize: 18),
        ),
        actions: [],
      ),
      // ignore: avoid_unnecessary_containers
      body: Container(
        child: ListView.separated(
          // To add separation line between the ListView
          separatorBuilder: (context, index) =>
              Divider(color: Colors.transparent),

          itemCount: items.length,
          itemBuilder: (BuildContext context, int index) {
            return ListTile(
              trailing: Text(items[index]["id"]),
              title: Text(items[index]["name"]),
            );
          },
        ),
      ),
    );
  }
}
